﻿<Window x:Class="SolickManagerV3_4.Windows.AddOrEditAssemblyWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:SolickManagerV3_4.Windows"
        mc:Ignorable="d"
        Icon="Images/SolulCompIcon.ico"
        Title="SoulComp Manager" Height="700" Width="600">
    <Border Width="550"
            Height="620"
            CornerRadius="10"
            Background="#3993DD"
            Padding="25">
        <StackPanel>
            <TextBlock Foreground="White"
                       Height="25"
                       VerticalAlignment="Top"
                       HorizontalAlignment="Center"
                       FontSize="20"
                       FontFamily="Inter"
                       FontWeight="Medium"
                       Text="Группа товаров"
                       Margin="0 0 0 6"/>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"
                        Margin="10 10 0 10">
                <TextBlock Text="Название"
                           Foreground="White"
                           FontFamily="Inter"
                           FontSize="16"
                           Height="20"/>
                <TextBox Width="250" 
                          Margin="10 0 0 0" 
                          Text="{Binding EditTitle, UpdateSourceTrigger=PropertyChanged}"/>
            </StackPanel>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <StackPanel HorizontalAlignment="Center">
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"
                        Margin="10 0 0 0">
                        <TextBlock Text="Дата"
                           Foreground="White"
                           FontFamily="Inter"
                           FontSize="16"
                           Height="20"/>
                        <TextBox Width="110"
                                 x:Name="DataTextBox"
                          Margin="10 0 10 0" 
                          Text="{Binding EditData, UpdateSourceTrigger=PropertyChanged}"/>
                        <Button Content="сегодня"
                        Style="{DynamicResource ButtonRoundStyle}"
                        Background="White"
                        Width="70"
                        FontSize="14"
                        FontWeight="Medium"
                        Click="SetToday"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"
                        Margin="0 10 0 0">
                        <TextBlock Text="Подборщик"
                           Foreground="White"
                           FontFamily="Inter"
                           FontSize="16"
                           Height="20"
                           Margin="10 0 00 0"/>
                        <ComboBox
                          Width="140" 
                          Margin="2 0" 
                          ItemsSource="{Binding Workers}"
                          DisplayMemberPath="FIO"
                          SelectedItem="{Binding SelectedConfigureWorker}"/>
                    </StackPanel>
                </StackPanel>
                <StackPanel Grid.Column="1">
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"
                        Margin="10 0 0 0">
                        <TextBlock Text="Стоимость"
                           Foreground="White"
                           FontFamily="Inter"
                           FontSize="16"
                           Height="20"/>
                        <TextBox Width="140" 
                                 x:Name="CostTextBox"
                          Margin="10 0 10 0" 
                          Text="{Binding EditCost, UpdateSourceTrigger=PropertyChanged}"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"
                        Margin="0 10 0 0">
                        <TextBlock Text="Сборщик"
                           Foreground="White"
                           FontFamily="Inter"
                           FontSize="16"
                           Height="20"
                           Margin="10 0 10 0"/>
                        <ComboBox
                          Width="155" 
                          Margin="2 0" 
                          ItemsSource="{Binding Workers}"
                          DisplayMemberPath="FIO"
                          SelectedItem="{Binding SelectedAssemblyWorker}"/>
                    </StackPanel>
                </StackPanel>

            </Grid>
            
            <Border CornerRadius="10"
                                Background="White"
                                BorderThickness="0"
                                Width="500"
                                MinHeight="100"
                                Padding="5"
                                Margin="0 10 0 0">
                <StackPanel 
                                    Width="500"
                                    Height="375">
                    <Label  Content="Товары:"
                                        FontSize="14"
                                        Foreground="Black"
                                        FontFamily="Inter/#Inter-V.ttf"
                                        Height="24"/>
                    <DataGrid x:Name="ProductsListView" 
                              AutoGenerateColumns="False"
                                          ItemsSource="{Binding OtherFunctons.AssemblyProducts}"
                                          SelectedItem="{Binding SelectedAssemblyProduct}"
                                          BorderThickness="0"
                                          FontSize="12"
                                          Foreground="Black"
                                          FontFamily="Inter/#Inter-V.ttf"
                                          Width="490"
                                          Height="350"
                              Margin="-8 0 0 0"
                                          HorizontalAlignment="Center">
                        <DataGrid.Columns>
                            <DataGridTextColumn Header="Модель" Width="224*" Binding="{Binding IdproductNavigation.Model}"/>
                            <DataGridTextColumn Header="Кол-во" Width="55*" Binding="{Binding AddCount}"/>
                            <DataGridTextColumn Header="Стоимость ед." Width="100*" Binding="{Binding IdproductNavigation.Cost}"/>
                            <DataGridTextColumn Header="Общая стоимость" Width="120*" Binding="{Binding CostAll}"/>
                        </DataGrid.Columns>
                        <DataGrid.ContextMenu>
                            <ContextMenu>
                                <MenuItem Header="Добавить" Click="AddProductInGroup"/>
                                <MenuItem Header="Удалить" Click="DeleteProductFromGroup"/>
                            </ContextMenu>
                        </DataGrid.ContextMenu>
                    </DataGrid>
                </StackPanel>
            </Border>


            <Button x:Name="SaveButton"
                    Style="{DynamicResource ButtonRoundStyle}"
                    Content="Сохранить"
                    Width="260"
                    Margin="0 15 0 0"
                    Height="35"
                    Background="White"
                    FontSize="20"
                    FontWeight="Medium"
                    FontFamily="Inter"
                    Click="Save"/>
        </StackPanel>
    </Border>
</Window>
